package g4p.examples;

import g4p_controls.G4P;
import g4p_controls.GPassword;
import g4p_controls.GTabManager;
import g4p_controls.GTextField;
import processing.core.PApplet;

public class G4P_Password  extends PApplet {
	
	GPassword pwd;
	GTextField txf0, txf1;
	GTabManager tm;
	
	public void setup(){
		size(400,300);
		pwd = new GPassword(this, 20,140,100,30, G4P.SCROLLBARS_HORIZONTAL_ONLY);
		txf0 = new GTextField(this, 20,100,100,30, G4P.SCROLLBARS_HORIZONTAL_ONLY);
		txf1 = new GTextField(this, 20,180,100,30, G4P.SCROLLBARS_HORIZONTAL_ONLY);
		tm = new GTabManager();
		tm.addControls(txf0,pwd,txf1);
		txf0.setFocus(true);;
	}
	
	
	public void draw(){
		background(220);
		fill(0);
		String pword = pwd.getPassword();
		text("" +pwd.getWordLength(), 22, 20);
		text(">" + pword + "<", 22, 40);
	}
}
